FROM 192.168.1.31:5000/nginx:latest
LABEL maintainer="qiaoxuan"
ENV BACKENDIP=""
ENV LANG en_US.UTF-8
RUN mkdir -p /var/www/html
ADD conf/nginx.conf /etc/nginx/nginx.conf.template
ADD dist/ /var/www/html/
ENTRYPOINT [ "/bin/sh", "-c" ]
CMD ["envsubst '$BACKENDIP' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"]
EXPOSE 80
EXPOSE 443

# docker run --name dtp-web -e BACKENDIP="192.168.1.40:8080"  -p 15111:80 -d 192.168.1.31:5000/dtp-web:1.0

# docker rm dtp-web   &&  docker rmi  192.168.1.31:5000/dtp-web:1.0
